package cn.hibernatedemo.controller;

import cn.hibernatedemo.entity.Dept;
import cn.hibernatedemo.service.DeptBiz;

public class TestAdd {
    public static void main(String[] args) {
        /*新增*/
        Dept dept = new Dept();
        dept.setDeptno(new Byte("11"));
        dept.setDname("测试部");
        dept.setLoc("东区");
        //保存新部门信息
        new DeptBiz().addNewDept(dept);

        /*修改*/
        dept.setDeptno(new Byte("11"));
        dept.setDname("质管部");
        dept.setLoc("东区");
        //更新部门信息
        new DeptBiz().addNewDept(dept);

        /*示例10*/
        dept.setDeptno(new Short("12"));
        dept.setDname("开发部");
        dept.setLoc("西区");
        //更新部门信息
        new DeptBiz().mergeDept(dept);
    }
}
